﻿'Imports System.Windows.Input
'Imports System.Reflection
'Imports System.Collections.ObjectModel

' ''' <summary>
' ''' 
' ''' </summary>
' ''' <remarks></remarks>
'Public Class DelegateCommand
'    Implements ICommand

'    Private ReadOnly _canExecute As Func(Of Object, Boolean)
'    Private ReadOnly _execute As Action(Of Object)

'    ''' <summary>
'    ''' 
'    ''' </summary>
'    ''' <remarks></remarks>
'    Public Event CanExecuteChanged As EventHandler Implements ICommand.CanExecuteChanged

'    ''' <summary>
'    ''' 
'    ''' </summary>
'    ''' <param name="execute"></param>
'    ''' <remarks></remarks>
'    Public Sub New(ByVal execute As Action(Of Object))
'        Me.New(execute, Nothing)
'    End Sub

'    ''' <summary>
'    ''' 
'    ''' </summary>
'    ''' <param name="execute"></param>
'    ''' <param name="canExecute"></param>
'    ''' <remarks></remarks>
'    Public Sub New(ByVal execute As Action(Of Object), ByVal canExecute As Func(Of Object, Boolean))
'        _execute = execute
'        _canExecute = canExecute
'    End Sub

'    ''' <summary>
'    ''' 
'    ''' </summary>
'    ''' <remarks></remarks>
'    Protected Overridable Function CanExecute(ByVal parameter As Object) As Boolean Implements System.Windows.Input.ICommand.CanExecute
'        If _canExecute Is Nothing Then
'            Return True
'        End If
'        If _execute Is Nothing Then
'            Return False
'        End If
'        Return _canExecute(parameter)
'    End Function

'    ''' <summary>
'    ''' 
'    ''' </summary>
'    ''' <remarks></remarks>
'    Protected Overridable Sub Execute(ByVal parameter As Object) Implements System.Windows.Input.ICommand.Execute
'        _execute(parameter)
'    End Sub

'    ''' <summary>
'    ''' 
'    ''' </summary>
'    ''' <remarks></remarks>
'    Public Sub RaiseCanExecuteChanged()
'        If Not CanExecuteChangedEvent Is Nothing Then
'            RaiseEvent CanExecuteChanged(Me, EventArgs.Empty)
'        End If
'    End Sub


'End Class




